// $Id: def.hpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#ifndef XPCOM_TEST_ARRAY_DEF_HPP
#define XPCOM_TEST_ARRAY_DEF_HPP

#include <xpcom/config.hpp>
#include <boost/mpl/list.hpp>
#include <xpcom/types.hpp>

struct A
{
    static int count;
    int n;

    A() : n(9) { ++count; }
    ~A() { --count; }

    bool operator==(const A& x) const { return n == x.n; }
};

struct A_count_guard
{
    A_count_guard() : count_(A::count) {}
    ~A_count_guard() { A::count = count_; }
    int count_;
};

typedef boost::mpl::list<
    int, double, bool,
    xpcom::uint16_t, char*, void*, xpcom::uuid, A, A*> test_types;

typedef boost::mpl::list<
    xpcom::int8_t, xpcom::uint8_t, xpcom::int16_t, xpcom::uint16_t,
    xpcom::int32_t, xpcom::uint32_t, xpcom::int64_t, xpcom::uint64_t,
    char, xpcom::wchar> test_types_integral;

typedef boost::mpl::list<char*, xpcom::wchar*> test_types_pstring;

#endif // XPCOM_TEST_ARRAY_DEF_HPP
